#pragma once
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

enum
{
    SOCKET_ERROR = 1,
    BIND_ERROR,
    LISTEN_ERROR,
    EPOLL_CREATE_ERROR
};
 
void SetNoBlock(int fd) 
{
    int fl = fcntl(fd, F_GETFL);
    if (fl < 0) 
    {
        perror("fcntl");
        return;
    }
    fcntl(fd, F_SETFL, fl | O_NONBLOCK);
}
